using System;

namespace DapperExtensionsNew
{
    public class BaseObjEx
    {
        private DateTime _updateTime;

        private readonly DateTime _now = DateTime.Now;

        public DateTime CreatedTime
        {
            get;
            set;
        }

        public DateTime UpdatedTime
        {
            get
            {
                if (_updateTime <= DateTime.MinValue)
                {
                    return _now;
                }
                return _updateTime;
            }
            set
            {
                _updateTime = value;
            }
        }

        public bool IsDeleted
        {
            get;
            set;
        }

        public string Operator
        {
            get;
            set;
        }

        public BaseObjEx()
        {
            CreatedTime = _now;
        }
    }
}
